const main = () => require.ensure([], nlapp.GlobalComponents.main);
const NULL = () => require.ensure([], nlapp.GlobalComponents.NULL);

export default {
	path: "/rc",
	component: NULL,
	name: "资源中心",
	children: [
		{
			path: "courseware",
			name: "课件管理",
			component: main,
			children: [
				{
					path: "search", // 完整地址: /rc/courseware/search
					name: "检索资源",
					component: () => import("../pages/courseware/search/index.vue")
				},
				{
					path: "wait", // 完整地址: /rc/courseware/wait
					name: "待处理课件",
					component: () => import("../pages/courseware/wait/index.vue")
				},
				{
					path: "audit",
					name: "审核课件",
					component: NULL,
					children: [
						{
							path: "qc", // 完整地址:/rc/courseware/audit/qc
							name: "待质检",
							component: () => import("../pages/courseware/audit/qc/index.vue")
						},
						{
							path: "wait", // 完整地址:/rc/courseware/audit/wait
							name: "待审核",
							component: () => import("../pages/courseware/audit/wait/index.vue")
						},
						{
							path: "fail", // 完整地址:/rc/courseware/audit/fail
							name: "审核不通过",
							component: () => import("../pages/courseware/audit/fail/index.vue")
						}
					]
				},
                {
					path: "copy", // 完整地址: /rc/courseware/copy
					name: "复制课件",
					component: () => import("../pages/courseware/copy/index.vue")
				},
				{
					path: "preview", // 完整地址:/rc/courseware/preview
					name: "课件预览",
					component: () => import("../pages/courseware/preview/index.vue"),
					props: ({ query }) => ({
						id: query.id, // 资源id，必填，否则此页面无意义
						pageIndex: query.pageIndex // 资源列表当前页，返回列表时使用
					})
				},
				{
					path: "relevance-detail", // 完整地址:/rc/courseware/relevance-detail
					name: "课件使用详情",
					component: () => import("../pages/courseware/relevance-detail/index.vue")
				},
				{
					path: "dots", // 完整地址:/rc/courseware/dots
					name: "课件打点",
					component: () => import("../pages/courseware/dots/index.vue"),
                    props: ({ query }) => ({
						id: query.id, // 资源id，必填，否则此页面无意义
						videoVid: query.videoVid, // 资源videoVid，必填，否则此页面无意义
						pageIndex: query.pageIndex // 资源列表当前页，返回列表时使用
					})
				}
			]
		},
		{
			path: "questions",
			name: "试题库",
			component: main,
			children: [
				{
					path: "list", // 完整地址:/rc/questions/list
					name: "试题管理",
					component: () => import("../pages/questions/list/index.vue")
				},
				{
					path: "add", // 完整地址:/rc/questions/add
					name: "添加试题",
					component: () => import("../pages/questions/add/index.vue")
				},
				{
					path: "edit", // 完整地址:/rc/questions/edit
					name: "编辑试题",
					component: () => import("../pages/questions/edit/index.vue")
				}
			]
		},
		{
			path: "tag",
			name: "标签管理",
			component: main,
			children: [
				{
					path: "list", // 完整地址:/rc/tag/list
					name: "资源标签",
					component: () => import("../pages/tag/list/index.vue")
				},
				{
					path: "add", // 完整地址:/rc/tag/add
					name: "添加标签",
					component: () => import("../pages/tag/add/index.vue")
				},
				{
					path: "edit", // 完整地址:/rc/tag/edit
					name: "编辑标签",
					component: () => import("../pages/tag/edit/index.vue"),
					props: ({ query }) => ({
						id: query.id // 资源id，必填，否则此页面无意义
					})
				},
				{
					path: "course", // 完整地址:/rc/tag/course 系列课管理
					name: "系列课管理",
					component: () => import("../pages/tag/course/index.vue")
				},
				{
					path: "chapter-knowledge", // 完整地址:/rc/tag/chapter-knowledge
					name: "章节知识点管理",
					component: () => import("../pages/tag/chapter-knowledge/index.vue")
				}
			]
		},
		{
			path: "system",
			name: "系统管理",
			component: main,
			children: [
				{
					path: "account", // 完整地址:/rc/system/account
					name: "课件上传账号",
					component: () => import("../pages/system/account/index.vue")
				}
			]
		},
		{
			path: "courseware-preview-batch", // 完整地址:/rc/courseware-preview-batch
			name: "课件预览", // 课件批量预览
			component: () => import("../pages/courseware/preview-batch/index.vue"),
			props: ({ query }) => ({
				ids: query.ids, // 逗号分隔的资源id集合
			})
		},
		{
			path: "questions-preview", // 完整地址:/rc/questions-preview
			name: "试题预览",
			component: () => import("../pages/questions/preview/index.vue"),
			props: ({ query }) => ({
				pageType: query.pageType, // 页面的展示类型，可选值 preview：纯展示题目，edit：编辑状态（编辑状态下无论哪种获取数据的方式，都必须存在完整的id信息）
				dataGetType: query.dataGetType, // 数据的获取方式，localStorageAll：本地数据（所有的数据获取都只依赖本地的localStorage缓存）,localStorageBase（只读取本地localStorage缓存中的试题id，试题类型，试题类型名称，其他的数据根据缓存id从服务端异步获取）
				localStorageKey: query.localStorageKey // 本地localStorage的存储key名称
			})
		}
	]
};
